package net.tatu.model;

import org.apache.log4j.Logger;
import org.springframework.web.multipart.MultipartFile;

public class UploadFile {
	Logger log = Logger.getLogger(UploadFile.class);
	/**
	 * 文件
	 */
	private MultipartFile imgFile;

	public MultipartFile getImgFile() {
		return imgFile;
	}

	public void setImgFile(MultipartFile imgFile) {
		this.imgFile = imgFile;
	}

	@Override
	public String toString() {
		return "UploadFile [imgFile=" + imgFile + "]";
	}
	
	public boolean validateFile() {
		log.info("文件类型：" + this.getImgFile().getContentType() + " 文件大小：" + this.getImgFile().getSize());
//		if(!ConstantUtil.fileTypeImg.contains(this.getImgFile().getContentType())){
//			throw new ServiceException("文件类型只能是jpeg、png！");
//		}
//		if(this.getImgFile().getSize() > 1000 * 100){	
//			throw new ServiceException("文件最大不能超过100KB！");
//		}
		return true;
	}

}
